package com.tdd;

import org.junit.Test;

public class RpnCalculatorWithFailingFactoryShould {
	static class OperationFactorySaboteur extends OperationFactory {

		@Override
		public Operation findOperationNamed(String operatorName) {
			throw new RuntimeException();
		}
	}

	@Test(expected = RuntimeException.class)
	public void leaveThrownExceptionAlone() {
		RpnCalculator calculator = new RpnCalculator(
				new OperationFactorySaboteur());
		
		calculator.execute("+");
	}
}
